<template>
  <el-dialog
    v-dialogDrag
    :title="dialogConfig.title"
    :width="dialogConfig.width"
    custom-class="com-dialog"
    :close-on-click-modal="false"
    :visible.sync="dialogConfig.show"
    @close="handelClose"
  >
    <slot name="dialogContent" />
  </el-dialog>
</template>

<script>
export default {
  name: 'ComDialog',
  props: {
    dialogConfig: {
      type: Object,
      default() {
        return {
          title: '这是一个标题',
          width: '50%',
          show: false,
          data: {}
        };
      }
    }
  },
  methods: {
    handelClose() {
      this.$emit('close');
    }
  }
};
</script>
